package org.jctc.els.common.utils;

public class ClassPayUtil {

	/*
	* 课酬计算公用公式
	* */

	public static Double getClassPay(Double data){

		if (data<500){
			return data;
		}else if(data<800){
			return data/(1-0.00105);
		}else if(data<500){
			return 0.00;
		}else if(data<3360){
			return (data/(1-0.20)-200)/(1-0.00105);
		}else if (data<21000){
			return (data/0.84)/(1-0.00105);
		}else if(data<49500){
			return (data-2000)/0.76/(1-0.00105);
		}else {
			return (data-7000)/0.68/(1-0.00105);
		}
	}

	/*
	* 增值税
	* */

	public static Double getValueAddedTax(Double data){
		if(data<500){
			return 0.00;
		}else {
			Double a = ClassPayUtil.getClassPay(data);
			return a*0.03;
		}
	}

	/*
	* 城建税
	* Urban construction tax
	* */

	public static Double getUrbanConstructionTax(Double data){
		Double a = ClassPayUtil.getValueAddedTax(data);
		return a*0.035;
		/* round(B5*3.5%,2)*/
	}

	/*
	* 代缴个税金额
	*Amount of individual income tax paid
	* */

	public static Double getAmountIndividualTax(Double data){
		if(data<800){
			return 0.00;
		}else if(data<=3360){
			return data/(1-0.20)-200-data;
		}else if (data<=21000){
			return data/0.84-data;
		}else if (data<=49500){
			return (data-2000)/0.76-data;
		}else {
			return (data-7000)/0.68-data;
		}
	}


}
